<template>
	<div class="advert">
		<router-link :to="setPath()"><img :src="setImage(data.url)" /></router-link>
	</div>
</template>

<script>
	import { mapState } from 'vuex'
	export default {
		name: 'advert',
		props: ['data'],
		computed: {
			...mapState({
				item: state => state.IndexStore.advert
			})
		},
		methods: {
			setPath: function() {
				return '/introduce'
			},
			setImage: function(url) {
				return '' + url
			},
			changeArticle: function(name) {
				store.commit("changeArticle", name)
			}
		}
	}
</script>